const http = require('http')

const app = http.createServer((req, res) => {
  res.writeHead(200, {
    'Content-Type': 'application/plain',
    'Access-Control-Allow-Origin': '*'
  })

  const data = JSON.stringify({
    name: 'heyi',
    age: 20
  })
  res.end(data)
})

app.listen(3000, () => {
  console.log('server is running')
})